

package com.hazelcast.internal.json;

import com.hazelcast.core.HazelcastException;

import java.io.IOException;

/**
 * This class is a placeholder for Json object/arrays that are not
 * parsed by {@link com.hazelcast.query.impl.getters.AbstractJsonGetter}.
 * It is used to distinguish between query paths that do not exist and
 * existing ones that does not terminate with either of `true`, `false`,
 * `null`, `number` or `string`.
 */
public class NonTerminalJsonValue extends JsonValue {

    public static final NonTerminalJsonValue INSTANCE = new NonTerminalJsonValue();

    @Override
    void write(JsonWriter writer) throws IOException {
        throw new HazelcastException("This object must not be encoded");
    }
}
